#include <iostream>
#include <fstream>
#include <string>
#include <cmath>

using namespace std;

int main() {
    int line_num = 0;
    int ans = 0;
    double max = 0;
    ifstream file {"./99.txt"};
    string line;
    size_t pos;
    while (getline(file, line)) {
        ++line_num;
        int base = stoi(line, &pos);
        int power = stoi(line.substr(pos + 1));
        double tmp = power * log(base);
        if (tmp > max) {
            max = tmp;
            ans = line_num;
        }
    }
    cout << ans << endl;
    file.close();
}